<template>
<div id="dailyBuildTest">
  <div class="up">
    <div class="item" v-for="item in titleItem" :key="item.data">
      <p class="ml-3 colorBlue fw-t">{{ item.title }}</p>
      <div v-for="(item,data) in opinionData" :key="data">
        <!-- <p class="ml-3 colorGrass fw-d">{{item.data}}</p> -->
        <p class="ml-3 colorGrass fw-d">{{data}}</p>
      </div>
    </div>
  </div>
</div>
</template>

<script>
 export default {
    mounted() {
      this.getdata();
      // console.log(this.getdata())
    },
    created() {
      this.getdata();
      // console.log(this.getdata())
    },
    data() {
      let opinionData = {"time": "2021-04-08", "version": "21210408", "pass": 85, "result": "Fail"};
      // let opinionData= this.getdata();
      // console.log(getdata());
      return {
        // opinionData:[],
        // opinionData:{"time": "2021-04-08", "version": "21210408", "pass": 85, "result": "Fail"},
        titleItem: [
        {
          title: "构建时间",
          data: opinionData.time
        },
        {
          title: "构建版本",
          data: opinionData.version
        },
        {
          title: "通过率",
          data: opinionData.pass
        }],
      };
    },
    methods: {
    getdata(){
        this.$http({ method: 'get',
                    url: 'show/dailybuild/?system='+this.$global.system,}).then(response => {
                    // console.log(response.data);
                    return response.data;
                    // this.opinionData = response.data;
                },
                // response => {
                //     console.log("error");
                // }
                );
    }
  }
  };
</script>

<style lang="scss" scoped>
#dailyBuildTest {
  display: flex;
  .up {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    font-size: 20px;
    // padding-top: 0.2rem;
    .item {
      border-radius: 0.0625rem;
      padding-top: 0.2rem;
      margin-top: 1rem;
      width: 32%;
      height: 0.875rem;
    }
    // .fw-t {
    //   border-radius: 0.0625rem;
    //   padding-top: 0.2rem;
    //   margin-top: 1rem;
    //   width: 32%;
    //   height: 0.875rem;
    // }
    .fw-d {
      border-radius: 0.0625rem;
      padding-top: 0.2rem;
      margin-top: 0.2rem;
      // width: 32%;
      height: 0.875rem;
    }
  }
}
</style>